import { ArticleModel } from '~/server/models/article.model';

export default defineEventHandler(async () => {
	try {
		const list = await ArticleModel.find({ isTop: true }).sort({ updatedAt: -1 }).lean();
		return { code: 1, data: { list } };
	} catch (e: any) {
		return { code: 0, message: e.message };
	}
});
